package com.zhiyou.service.impl;

import com.zhiyou.dao.LogisticsMapper;
import com.zhiyou.entity.Logistics;
import com.zhiyou.service.LogisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

//后勤人员管理
@Service
public class LogisticsServiceImpl implements LogisticsService {
    @Autowired
    LogisticsMapper logisticsMapper;
    //查询所有后勤人员
    @Override
    public List<Logistics> getAllLogistics() {
        return logisticsMapper.getAllLogistics();
    }

    //根据姓名,手机号,性别 进行模糊查询
    @Override
    public List<Logistics> getLogisticsLikeAll(String likes) {
        return logisticsMapper.getLogisticsLikeAll(likes);
    }
    //新增后勤人员
    @Override
    public int addLogistics(Logistics logistics) {
        Date date=new Date();
        Timestamp timestamp=new Timestamp(date.getTime());
        logistics.setLoTime(timestamp);
        return logisticsMapper.addLogistics(logistics);
    }
    //删除人员
    @Override
    public int deleteLogistics(Integer id) {
        return logisticsMapper.deleteLogistics(id);
    }

    //获取修改信息展示界面
    @Override
    public List<Logistics> selectLogistics(Integer id) {
        return logisticsMapper.selectLogistics(id);
    }
    //修改操作
    @Override
    public int updateLogistics(Logistics logistics) {
        return logisticsMapper.updateLogistics(logistics);
    }


}
